<?php
	require_once("action/dao/Connection.php");

	class LanguageDAO {
	
		/*public static function recherche($authentifier,$language)
		{
			$connection = Connection::connect();
			
			$query = "SELECT NOMPAGE,LIEN FROM B63_MENUS WHERE LANGUE=:planguage AND AUTHENTIFIER=:pauthentifier";
			
			$statement = oci_parse($connection, $query);
			
			oci_bind_by_name($statement, ":planguage", $language);
			oci_bind_by_name($statement, ":pauthentifier", $authentifier);
				
			oci_execute($statement);
			
			while ($row = oci_fetch_array($statement))
			{
				$reponse[]=$row;
			}						
			
			Connection::close($connection);	
		
			
			return $reponse;
		}*/
		
		public static function recherche($authentifier,$language)
		{
			$xml = new SimpleXMLElement("action\\dao\\db\\Menus.xml",NULL,true);
			
			$reponse=array();
			
			foreach($xml->menus->$authentifier->$language->titres as $temp)
			{
				$reponse[]=array(utf8_decode($temp->page),utf8_decode($temp->lien));
			}
			
			return $reponse;
		}		
	}	
	
?>